package com.jxs.android.weiget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.jxs.android.ges.R;

public class BuCommonTableView_Business_Item extends LinearLayout {

	private TextView index,// 序号
			product_type_name,// 业务类型
			serv_num,// 用户数
			stock_income;// 存量收入

	public BuCommonTableView_Business_Item(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public BuCommonTableView_Business_Item(Context context) {
		this(context, null);
		init(context);
	}

	private void init(Context context) {
		LayoutInflater.from(context).inflate(R.layout.bu_table_view_business_item, this);

		index = (TextView) findViewById(R.id.index);
		product_type_name = (TextView) findViewById(R.id.product_type_name);
		serv_num = (TextView) findViewById(R.id.serv_num);
		stock_income = (TextView) findViewById(R.id.stock_income);
	}

	public void setBackgroud(int resid) {
		index.setBackgroundResource(resid);
		product_type_name.setBackgroundResource(resid);
		serv_num.setBackgroundResource(resid);
		stock_income.setBackgroundResource(resid);
	}

	public void setTextColor(int resid) {
		index.setTextColor(resid);
		product_type_name.setTextColor(resid);
		serv_num.setTextColor(resid);
		stock_income.setTextColor(resid);
	}

	public void setValue(String i_index, String i_product_type_name, String i_serv_num, String i_stock_income) {
		index.setText(i_index);
		product_type_name.setText(i_product_type_name);
		serv_num.setText(i_serv_num);
		stock_income.setText(i_stock_income);
	}

	public void setproduct_type_nameGravityCenter() {
		product_type_name.setGravity(Gravity.CENTER);
	}

}